package com.bj.dz.service.impl;


import java.util.ArrayList;

import java.util.List;

import javax.annotation.Resource;

import com.bj.dz.entity.MenuUtil;
import com.bj.dz.entity.TreeBean;
import com.bj.dz.mapper.MenuUtilMapper;
import com.bj.dz.service.MenuUtilService;
import org.springframework.stereotype.Service;

@Service("menuUtilService")
public class MenuUtilServiceImp implements MenuUtilService {
	@Resource
	private MenuUtilMapper mud;


	
	/**
	 * ��װǰ̨��Ҫ�Ĳ˵�
	 */
	@Override
	public List<TreeBean> findAllMenu() {
		List<MenuUtil> menuList=mud.findAllMenu();
		List<TreeBean> tbList=new ArrayList<TreeBean>();
		for (MenuUtil menuUtil : menuList) {
			String pid=menuUtil.getPmenuNum();
			String id=menuUtil.getMenuNum();
			String text=menuUtil.getMenuText();
			String attributes=menuUtil.getMenuUrl();
			TreeBean tb=new TreeBean(pid, id, text, attributes);
			tbList.add(tb);
		}
		return tbList;
	}


	
	
	
}
